/***************************updaterfactory.cpp*****************************/
/*****************************************************************************/
/*******************Browsers Daily Build Updater************************/
/************Copyright (C) 2010-2011  Gianluigi Biancucci*************/
/*****************************************************************************/
/*****This is free software, and you are welcome to redistribute it****/
/*****and / or modify underthe terms of GPLV2 License.**************/
/*****This program comes with ABSOLUTELY NO WARRANTY*****/
/*****************************************************************************/

#include "UpdaterFactory.h"
#include "firefoxupdater.h"
#include"IBrowserUpdater.h"
#include "chromiumupdater.h"
#include "operaupdater.h"
UpdaterFactory::UpdaterFactory()
{

}

QString UpdaterFactory::browser="";

QString UpdaterFactory::arch="32";

QString UpdaterFactory::path="";


IBrowserUpdater * UpdaterFactory::getInstance(){
    if (browser == "Firefox")
        return new FirefoxUpdater(arch,path);
    else{
        if (browser == "Chromium") return new ChromiumUpdater(arch,path);
        else {
            if (browser == "Opera") return new OperaUpdater(arch,path); else return 0;
        }
    }
}

void UpdaterFactory::setUpdater(QString name){

    browser = name;
}
void UpdaterFactory::setArch(QString value){

    arch=value;
}

void UpdaterFactory::setPath(QString value){

    path=value;
}
